import { defineStore } from 'pinia'

interface IState{
    data:Array<IData>,
    maskShow:boolean,
    maskTitle:string,
    nowClick:number
}
interface IData{
    bianhao:string,
    names:string,
    pre:string,
    sum:string,
    status:string,
    display:string,
}
const useListing = defineStore('listing',{
    state:()=><IState>({
        data:[{}],
        maskShow:false,
        maskTitle:'',
        nowClick:0
    }),
    actions:{
        setData(datas:Array<IData>){
            this.data = datas;
        },
        setMaskShow(str:string,index?:number){
            this.maskShow = !this.maskShow;
            this.maskTitle = str;
            this.nowClick = index;
        },
        changeData(index:number,obj:any){
            this.data[index] = obj;
        }
    },
    getters:{
        
    }
})
export default useListing;